/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tree;

import java.util.List;

/**
 *
 * @author Ej-Dý
 */
public class VariableFunTree extends Tree {


    private String name;
    private Type type;
   
    private FunTeloTree ft;
    public ArgumentTree arg;
    /**
     * Slot, v nemz je tato promenna.
     */
    private int slot;

    public VariableFunTree(Position start, Position end, String name,FunTeloTree ft,Type type, ArgumentTree arg) {
        super(start, end);
        this.name = name;
        
        this.ft=ft;
        this.type=type;
        this.arg = arg;
    }

    public String getName() {
        return name;
    }

   

    public Type getType() {
        return type;
    }

    public SymTab getSymTab(){
        return arg.getSymTab();
    }
    public ArgumentTree getArg(){
        return arg;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public int getSlot() {
        return slot;
    }

    public void setSlot(int slot) {
        this.slot = slot;
    }

    @Override
    public void accept(TreeVisitor visitor) {
        visitor.visitVariableFun(this);
    }

    @Override
    public void generate(Context ctx) {
        // tato metoda by se nemela nikdy zavolat
        assert false;
    }

    @Override
    public String toString() {
        return String.format("VariableFun %s: [%s, %s,%s, %d,%s]", super.toString(), name, type,ft, slot, arg);
    }

    /**
     * @param ft the ft to set
     */
    public void setFt(FunTeloTree ft) {
        this.ft = ft;
    }


}
